﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using SHKF.B2C.BaseHosted;
using SHKF.B2C.BLL.Order;
using SHKF.B2C.Hosted;
using SHKF.B2C.Model.Dto;
using SHKF.B2C.Model.Dto.Order;
using SHKF.B2C.Model.Entity.Order;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace SHKF.B2C.WebService.Controllers
{
    [Route("[controller]")]
    [ApiController]
    public class OrderController : BaseController
    {
        private readonly OrderBLL orderBLL;
        public OrderController(
            OrderBLL orderBLL,
            ILogger<OrderController> logger) : base(logger)
        {
            this.orderBLL = orderBLL;
        }

        ///// <summary>
        ///// 接收第三方平台解析后的销售单, 赞时只有美团闪购
        ///// </summary>
        ///// <param name="shopSN"></param>
        ///// <param name="status"></param>
        ///// <param name="create_start"></param>
        ///// <param name="create_end"></param>
        ///// <param name="logistics_status"></param>
        ///// <returns></returns>
        //[HttpGet("list")]
        //public OrderListDto List(long shopSN, int status, DateTime create_start, DateTime create_end, int logistics_status = -1)
        //{
        //    //定单列表

        //    OrderListDto dto = new OrderListDto();
        //    try
        //    {
        //        List<OrderContentEntity> orderList = this.orderBLL.Query(shopSN, status, create_start, create_end);
        //        foreach (OrderContentEntity orderEntity in orderList)
        //        {
        //            this.orderBLL.platform = orderEntity.Platform;
        //            List<OrderDetailEntity> detial = this.orderBLL.QueryDetail(orderEntity.order_id);
        //            orderEntity.detail = detial;
        //        }
        //        dto.Data = orderList;
        //    }
        //    catch (Exception ex)
        //    {
        //        dto = new OrderListDto();
        //        dto.error = new Error() { code = -1, msg = ex.Message };
        //        base.WriteException("List", ex);
        //    }
        //    return dto;
        //}
 
    }
}
